﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Xna.Framework.Content;

namespace AffichageGrille
{
    class Monde
    {
        public Level[,] Levels { get; set; }

        public Level LevelEnCours { get; set; }

        public Monde(ContentManager content)
        {
            Levels = new Level[2, 2];

            // Chargement des levels
            string[] fichiersLevel = Directory.GetFiles(Config.DossierLevels);

            foreach (string fichierLevel in fichiersLevel)
            {
                FileInfo file = new FileInfo(fichierLevel);

                int x = int.Parse(file.Name[0].ToString());
                int y = int.Parse(file.Name[2].ToString());

                Levels[x, y] = new Level(fichierLevel,content, x, y);
            }

            LevelEnCours = Levels[0, 0];
        }
    }
}
